/*
*abstract:发送信号的客户端
*author:张玉行
*email:zhangyuhang2009@gmail.com
*date:2011.10.12
*/
#include <stdio.h>
#include <signal.h>

int main( int argc,char* argv[]){
	if(argc != 3){
		printf("请输入%s signum pid\n",argv[0]);
		return 0;
	}
	pid_t pid = (pid_t)atoi(argv[2]);
	int signum = atoi(argv[1]);
	union sigval val;
	val.sival_int = 777;
	printf("pid=%d signum=%d \n",pid,signum);
	if(sigqueue(pid,signum,val) == -1){
		printf("send error\n");
	}else{
		printf("ok\n");
	}
}

